package com.tool.image;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

public class Creepsskin {
	//根据id换取性别0女 1男
	public static int getSex(BigDecimal se) {
		int id = se.intValue() % 10;
		return (id == 1 || id == 2 || id == 3 || id == 7 || id == 9) ? 1 : 0;
	}
	// 获取种族
	public static int getRace(BigDecimal se) {
		if (se == null) {return 0;}
		return 9981+se.intValue()/1000;
	}
	static Map<Integer,String> localNameMap;
	static{
		localNameMap=new HashMap<>();
		localNameMap.put(20001, "逍遥生");
		localNameMap.put(20002, "剑侠客");
		localNameMap.put(20003, "猛壮士");
		localNameMap.put(20004, "飞燕女");
		localNameMap.put(20005, "英女侠");
		localNameMap.put(20006, "俏千金");
		localNameMap.put(20007, "飞剑侠");
		localNameMap.put(20008, "燕山雪");
		localNameMap.put(20009, "纯阳子");
		localNameMap.put(20010, "红拂女");
		localNameMap.put(20011, "神秀生");
		localNameMap.put(20012, "玲珑女");

		localNameMap.put(21001, "虎头怪");
		localNameMap.put(21002, "夺命妖");
		localNameMap.put(21003, "巨魔王");
		localNameMap.put(21004, "小蛮妖");
		localNameMap.put(21005, "骨精灵");
		localNameMap.put(21006, "狐美人");
		localNameMap.put(21007, "逆天魔");
		localNameMap.put(21008, "媚灵狐");
		localNameMap.put(21009, "混天魔");
		localNameMap.put(21010, "九尾狐");
		localNameMap.put(21011, "绝影魔");
		localNameMap.put(21012, "霜月灵");

		localNameMap.put(22001, "神天兵");
		localNameMap.put(22002, "智圣仙");
		localNameMap.put(22003, "龙战将");
		localNameMap.put(22004, "精灵仙");
		localNameMap.put(22005, "舞天姬");
		localNameMap.put(22006, "玄剑娥");
		localNameMap.put(22007, "武尊神");
		localNameMap.put(22008, "玄天姬");
		localNameMap.put(22009, "紫薇神");
		localNameMap.put(22010, "霓裳仙");
		localNameMap.put(22011, "青阳使");
		localNameMap.put(22012, "云中君");

		localNameMap.put(23001, "祭剑魂");
		localNameMap.put(23002, "猎魂引");
		localNameMap.put(23003, "无崖子");
		localNameMap.put(23004, "墨衣行");
		localNameMap.put(23005, "夜溪灵");
		localNameMap.put(23006, "幽梦影");
		localNameMap.put(23007, "南冠客");
		localNameMap.put(23008, "镜花影");

		localNameMap.put(24001, "沧浪君");
		localNameMap.put(24002, "龙渊客");
		localNameMap.put(24003, "忘忧子");
		localNameMap.put(24004, "骊珠儿");
		localNameMap.put(24005, "木兰行");
		localNameMap.put(24006, "莫解语");
		localNameMap.put(24007, "游无极");
		localNameMap.put(24008, "临九渊");
	}
	/***/
	public static String getLocalName(int id){
		return localNameMap.get(id);
	}
	public static int getLocalID(String localName){
		for (int key:localNameMap.keySet()) {
			if (localNameMap.get(key).equals(localName)) {
				return key;
			}
		}
		return 20001;
	}
}
